const express = require('express')
const app = express()

const mw = (req, res, next) => {
  console.log('这是一个最简单的中间件');
  req.msg = '体验中间件'
  next()
}
app.use(mw)

app.get('/test', (req, res) => {
  res.send(req.msg)
})

app.listen(8089, () => {
  console.log('启动成功');
})